From d0b30dab401c0ef4f76d36c0f4deb60e549fac77 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 13 Sep 2005 16:57:45 +0000 Subject: [PATCH] Fix domain list build/cleanup code with xend subdirectory. Signed-off-by: Christian Limpach --- tools/python/xen/xend/XendDomain.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index 2748905cd0..4c7f8250af 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -130,8 +130,11 @@ class XendDomain: doms = self.xen_domains() self.dbmap.readDB() for domdb in self.dbmap.values(): + if not domdb.has_key("xend"): + continue + db = domdb.addChild("xend") try: - domid = int(domdb.id) + domid = int(db.id) except: domid = None # XXX if domid in self.domains, then something went wrong @@ -139,7 +142,7 @@ class XendDomain: domdb.delete() elif domid in doms: try: - self._new_domain(domdb['uuid'], domdb, doms[domid]) + self._new_domain(db.uuid, db, doms[domid]) except Exception, ex: log.exception("Error recreating domain info: id=%d", domid) self._delete_domain(domid) @@ -204,8 +207,11 @@ class XendDomain: eserver.inject('xend.domain.died', [info.name, info.id]) # XXX this should not be needed for domdb in self.dbmap.values(): + if not domdb.has_key("xend"): + continue + db = domdb.addChild("xend") try: - domid = int(domdb.id) + domid = int(db.id) except: domid = None if (domid is None) or (domid == id): -- 2.30.2